<template>
    <div class="flex-main">
        <div class="flex-body">
            <div class="m-ment flex m-more m-addr" v-if="detail.shipping_status==1">
                {{address_info.Name || '美业通用户'}} {{address_info.Phone}}
                <p>
                    <em>默</em> {{address_info.Province}} {{address_info.City}} {{address_info.Area}} {{address_info.Address}}
                </p>
            </div>
            <div class="bg-white mb">
                <!-- //0自取；1配送 -->
                <p class="p1" v-if="detail.shipping_status==0">配送方式：门店自取</p>
                <p class="p1" v-else>配送方式：配送</p>
                <p class="ml mb">自取门店：{{detail.shop_name || '美业通门店'}}</p>

                <order-goodsinfo
                v-for="(item,index) in detail.goodsInfo" :key="index"
                 @click.native="toOrderdetail(item.Id,item.type)"
                  :goodsInfo="item" ></order-goodsinfo>

                <div class="m-order-right">
                    订单总价：<em>&yen;{{detail.total_amount}}</em>
                </div>
            </div>
            <ul class="bg-white m-orderNo">
                <li>物流公司：{{detail.ship_company || '暂无'}}</li>
                <li>物流单号：{{detail.ship_number || '暂无'}}</li>
                <li>订单编号：{{detail.order_sn}}</li>
                <li>付款时间：{{detail.add_date}}</li>
            </ul>
        </div>
        
    </div>
</template>
<script>
import {orderDetail} from '@/api/mine';
export default {
    name:'',
    data () {
        return {
            order_id:'',
            sourceFrom:'',
            detail:'',
        }
    },
    components:{
        orderGoodsinfo:()=>import('@/model/mine/orderGoodsinfo'),
    },
    methods: {
        // 跳转到项目详情
        toOrderdetail(id,type) {
            console.log(id+','+type)
            this.$router.push({path:'/projectDetail',query:{
                goodsid:id,
                type:type
            }});
        },
        // 获取订单详情
        getOrderDetail() {
            this.$indicator.open("加载中...");
            let param = {
                order_id:this.order_id,
                customer_id:this.$utils.uid,
                sourceFrom:this.sourceFrom
            }
            orderDetail(param).then((result) => {
                this.detail = result.list.data;
                this.$indicator.close();
            }).catch((err) => {
                
            });
        }
    },
    mounted() {
        this.order_id = this.$route.query.order_id;
        this.sourceFrom = this.$route.query.sourceFrom;
        this.getOrderDetail();
    }
}
</script>
<style lang="less" scoped src="@/less/mine/myOrders.less"></style>
